<?php
    /* For user login if wrong redirect to index/login */
    if($_SERVER['REQUEST_METHOD'] == "POST")
    {
       if(!$login)
        {
            ?>
            <script type="text/javascript">
               showNotification({
                           message: "Invalid username,password or captcha code, Try to login again.",
                           type: "error",
                           autoClose: true,
                           duration: 2
                        });
            </script>
            <?php
        }
    }
?>
<div class="container">
    <div class="form-signin" style="background-color: #ffffdf;border-radius: 15px 15px 5px 5px;">
        <div class="span4_1" style="margin-bottom: 10px; text-align: center;">
            <img src="/images/logo/FormAlistic.png" class="logo" width="200" height="80" style="cursor: pointer">
        </div>
        <div class="span4_1">
            <hr>
        </div>
        <div class="tabbable"> <!-- Only required for left/right tabs -->
            <ul class="nav nav-tabs">
              <li class="active"><a href="#tab1" data-toggle="tab">Login</a></li>
              <li><a href="#tab2" data-toggle="tab">Register User</a></li>
              <li><a href="#tab3" data-toggle="tab">Register Company</a></li>
              <!--li><a href="#tab3" data-toggle="tab">Forgot Password</a></li-->
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="tab1">
                    <h4 class="form-signin-heading">Please sign in</h4>
                    <form action="" method="POST">
                        <div class="input-prepend">
                            <span class="add-on"><li class="icon-user"></li></span>
                            <input class="span4 log" name="username" id="prependedInput" type="text" placeholder="Username" rel="tooltip" data-placement="right" data-original-title="Type your username.">
                        </div>
                        <br />
                        <div class="input-prepend">
                            <span class="add-on"><li class="icon-briefcase"></li></span>
                            <input class="span4 log" name="password" id="prependedInput" type="password" placeholder="Password" rel="tooltip" data-placement="right" data-original-title="Type your password.">
                        </div>
                        <div id="captcha-wrap" style="margin-bottom: 10px;">
                                <div class="captcha-box">
                                    <img src="/ajax/get_captcha" alt="" class="captcha" />
                                </div>
                                <div class="text-box">
                                    <!--label>Type the two words:</label-->
                                    <div style="margin-top: 8px;"></div>
                                    <input name="captcha-code" type="text" id="captcha-code" value="">
                                </div>
                                <div class="captcha-action">
                                    <img src="/images/themes/refresh.jpg"  alt="" id="captcha-refresh" />
                                </div>
                        </div>
                        <br />
                        <div class="row-fluid">
                            <div class="span6" style="margin-top: 8px;">
                                <label class="checkbox">
                                    <input type="checkbox" value="remember-me"> Remember me
                                </label>
                            </div>
                            <div class="span5">
                                <input class="btn pull-right" type="submit" class="loginClick" value="Sign in">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="tab-pane" id="tab2">
                  <h4 class="form-signin-heading">Register User</h4>
                  <h6>User Information</h6>
                  <form class="form-horizontal sign_up" method="POST">
                     <div class="control-group">
                       <label class="control-label" for="inputFirstname" style="text-align: left;width: 130px">Firstname:<span class="required">*</span></label>
                         <input type="text" id="inputFirstname" name="firstname" class="input-large" placeholder="Firstname">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="inputMiddlename" style="text-align: left;width: 130px">Middlename:</label>
                         <input type="text" id="inputMiddlename" name="middlename" class="input-large" placeholder="Middlename">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="inputLastname" style="text-align: left;width: 130px">Lastname:<span class="required">*</span></label>
                         <input type="text" id="inputLastname" name="lastname" class="input-large" placeholder="Lastname">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="inputEmail" style="text-align: left;width: 130px">Email:<span class="required">*</span></label>
                         <input type="text" id="inputEmail" name="email" class="input-large" placeholder="Email">
                     </div>
                     <h6>Account Information</h6>
                     <div class="control-group">
                       <label class="control-label" for="inputUsername" style="text-align: left;width: 130px">Username:<span class="required">*</span></label>
                         <input type="text" id="inputUsername" name="username" class="input-large" placeholder="Username">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="inputPassword" style="text-align: left;width: 130px">Password:<span class="required">*</span></label>
                         <input type="password" id="inputPassword" name="password" class="input-large">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="inputrPassword" style="text-align: left;width: 130px">Confirm Password:<span class="required">*</span></label>
                         <input type="password" id="inputrPassword" name="rpassword" class="input-large">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="inputCompanyCode" style="text-align: left;width: 130px">Company Code:<span class="required">*</span></label>
                         <input type="text" id="inputCompanyCode" name="companyCode" class="input-large" placeholder="Company Code">
                     </div>
                     <div id="captcha-wrap" style="margin-bottom: 10px;">
                              <div class="captcha-box">
                                  <img src="/ajax/get_captcha" alt="" class="captcha" />
                              </div>
                              <div class="text-box">
                                  <!--label>Type the two words:</label-->
                                  <div style="margin-top: 8px;"></div>
                                  <input name="captcha-code" type="text" id="captcha-code" value="">
                              </div>
                              <div class="captcha-action">
                                  <img src="/images/themes/refresh.jpg"  alt="" id="captcha-refresh" />
                              </div>
                      </div>
                     <div class="control-group">
                         <input type="button" class="btn reg_user" value="Register">
                     </div>
                   </form>
                </div>
                <div class="tab-pane" id="tab3">
                  <h4 class="form-signin-heading">Company Information</h4>
                  <form class="form-horizontal sign_up_company" method="POST">
                     <div class="control-group">
                       <label class="control-label" for="companyName" style="text-align: left;width: 130px">Company Name:<span class="required">*</span></label>
                         <input type="text" id="companyName" name="companyName" class="input-large" placeholder="Company Name">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="companyAddress" style="text-align: left;width: 130px">Address:<span class="required">*</span></label>
                         <input type="text" id="companyAddress" name="companyAddress" class="input-large" placeholder="Address">
                     </div>
                     <h6>Contact Details</h6>
                     <div class="control-group">
                       <label class="control-label" for="primaryContact" style="text-align: left;width: 130px">Primary Contact:<span class="required">*</span></label>
                         <input type="text" id="primaryContact" name="primaryContact" class="input-large" placeholder="Primary Contact">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="emailAddress" style="text-align: left;width: 130px">Email Address:<span class="required">*</span></label>
                         <input type="text" id="emailAddress" name="emailAddress" class="input-large" placeholder="Email Address">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="contactNumber" style="text-align: left;width: 130px">Contact Number:<span class="required">*</span></label>
                         <input type="text" id="contactNumber" name="contactNumber" class="input-large" placeholder="Contact Number">
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="companyCode" style="text-align: left;width: 130px">Company Code:<span class="required">*</span></label>
                         <input type="text" id="companyCode" name="companyCode" class="input-large" placeholder="Company Code">
                     </div>
                     <div id="captcha-wrap" style="margin-bottom: 10px;">
                              <div class="captcha-box">
                                  <img src="/ajax/get_captcha" alt="" class="captcha" />
                              </div>
                              <div class="text-box">
                                  <!--label>Type the two words:</label-->
                                  <div style="margin-top: 8px;"></div>
                                  <input name="captcha-code" type="text" id="captcha-code" value="">
                              </div>
                              <div class="captcha-action">
                                  <img src="/images/themes/refresh.jpg"  alt="" id="captcha-refresh" />
                              </div>
                      </div>
                     <!--h4 class="form-signin-heading">Approval Hierarchy</h4-->
                     <div class="control-group">
                         <input type="button" class="btn reg_company" value="Register">
                     </div>
                  </form>
                </div>
            </div>
        </div>
    </div>
</div>
